/**
 * ---------------------------
 * Time: 2017/5/13 18:41.
 * Author: Cangshi
 * View: http://palerock.cn
 * ---------------------------
 */
var normalRunningTrackConfig = {
    centrePoint: {
        x: 20,
        y: 20
    },
    speed: 0,
    acceleration: 0,
    direction: 0,
    maxSpeed: 10
};
var normalEffect = {
    type: 'particles', // 'particles'
    particles: {
        maxSize: 200,
        intervalTime: 50,
        config: {
            type: 'simple'
        }
    },
    effect: {
        type: 'rect',
        color: {
            type: 'rgba',
            r: 255,
            g: 255,
            b: 255,
            a: 0.6
        },
        width: 5,
        height: 5,
        degFaced: 0,
        isFaceDeg: false,
        rotate: {
            isRotate: true,
            frameDeg: 5
        },
        gradient: {
            isGradually: true,
            rate: 0.99
        }
    },
    runningTrack: {
        direction: Math.random() * 360,
        acceleration: -0.01,
        speed: 0.5
    }
};
var normalCanvasModel = {
    type: 'rect',
    img: {
        src: 'imgs/plane.png'
    },
    size: 40,
    isFaceDeg: false,
    degFaced: 0,
    rotate: {
        isRotate: true,
        frameDeg: 5
    },
    color: {
        type: 'hexadecimal',
        color: '#ffffff'
    },
    realWidth: 10,
    realHeight: 10,
    effectMap: {
        running: normalEffect
    }
};

var MyPlaneConfig = {
    name: 'my-plane',
    canvasModel: normalCanvasModel,
    runningTrack: normalRunningTrackConfig,
    playerTouch: {
        sensitivity: 2
    }
};

var obj = new CanvasInnerObject({});
var plane = obj.createChildNode(MyPlaneConfig, MyPlane);
var plane1 = obj.createChildNode(MyPlaneConfig.extend({
    runningTrack: {
        centrePoint:{
            x:300,
            y:500
        }
    }
},true), MyPlane);
var plane2 = obj.createChildNode(MyPlaneConfig.extend({
    runningTrack: {
        centrePoint:{
            x:200,
            y:400
        }
    }
},true), MyPlane);
var canvas = new Canvas({
    el: 'canvas'
});
canvas.addObject(obj);
canvas.startDraw();
// p2 = plane;
